Get Script Templates

This request retrieves a list of script templates.

HTTP Method

GET

URI

Copy
{{baseUrl}}/api/v2/scripttemplates?scriptType=Any&allDetails=true

Request Parameters

Parameter

Type

Description

Page Number

Integer Default value : 0

Page number in range to retrieve.

Page Size

Integer, Default value: 10

Number of pages in range to retrieve.

scriptType

String (query)

The script type defined in the Scripts Template Page. One of the following values:

Any
SBC
M365

allDetails

boolean (query). Default value: false

Queries additional details.

Example Response

Copy
[
  {
    "id": 5002,
    "name": "O365InitializationScript",
    "scriptType": 3,
    "description": null,
    "script": null,
    "customerVariables": null,
    "relatedScripts": [
      {
        "key": 5003,
        "value": "O365CleanupScript"
      }
    ]
  },
  {
    "id": 5003,
    "name": "O365CleanupScript",
    "scriptType": 4,
    "description": null,
    "script": null,
    "customerVariables": null,
    "relatedScripts": [
      {
        "key": 5002,
        "value": "O365InitializationScript"
      }
    ]
  },
  {
    "id": 5000,
    "name": "sbc-add-oc-numbers",
    "scriptType": 0,
    "description": null,
    "script": null,
    "customerVariables": null,
    "relatedScripts": null
  },
  {
    "id": 5001,
    "name": "sbc-remove-oc-numbers",
    "scriptType": 0,
    "description": null,
    "script": null,
    "customerVariables": null,
    "relatedScripts": null
  },
  {
    "id": 7,
    "name": "sbc-scenario7",
    "scriptType": 1,
    "description": null,
    "script": null,
    "customerVariables": null,
    "relatedScripts": [
      {
        "key": 700,
        "value": "sbc-scenario7Cleanup"
      },
      {
        "key": 700,
        "value": "sbc-scenario7Cleanup"
      }
    ]
  },
  {
    "id": 700,
    "name": "sbc-scenario7Cleanup",
    "scriptType": 2,
    "description": null,
    "script": null,
    "customerVariables": null,
    "relatedScripts": [
      {
        "key": 7,
        "value": "sbc-scenario7"
      },
      {
        "key": 7,
        "value": "sbc-scenario7"
      }
    ]
  },
  {
    "id": 100,
    "name": "sbc-add-prefix",
    "scriptType": 0,
    "description": null,
    "script": null,
    "customerVariables": null,
    "relatedScripts": null
  },
  {
    "id": 101,
    "name": "sbc-remove-prefix",
    "scriptType": 0,
    "description": null,
    "script": null,
    "customerVariables": null,
    "relatedScripts": null
  }
]

HTTP Responses

200 OK

Attribute

Type

Description

id

Integer

The unique id of the script. See SBC Template Scenarios for references to IDs for default SBC script templates. See M365 Template Scenarios for references to IDs for default M365 script templates.

customerVariables

String

Customer defined variables, mandatory for the script execution.

Corresponds to the "CustomerVariables" column in the database record. Its recommended not to define like variable1, variable2 and instead to use meaningful names e.g. localhostname. See SBC Template Scenarios for references to customer variables for default SBC script templates. See M365 Template Scenarios for references to customer variables for default M365 script templates.

name

String

Corresponds to the "Friendly Name" of the script column in the database record. For example, "sbc-scenario7".

scriptTemplateType

Integer

Specifies the type of action performed by the script. One of the following values:

1: SBC Add Script
2: SBC Cleanup
3: M365 Add Script
4: M365 Cleanup
5: OcSbcOnboarding
6: OcSbcCleanup
7: ArmCleanup
8: OcUploadNumber
9: OcReleaseNumber

See SBC Template Scenarios for references to customer variables for default SBC script templates. See M365 Template Scenarios for references to customer variables for default M365 script templates.

description

String

Corresponds to the "Description" column in the script record.

relatedScripts

List array

key: integer

value: string

 

The database id (key) and name of the related script. For example, script id '5000' with value 'sbc-add-oc-numbershas the related script id '5001' with value 'sbc-remove-oc-numbers'.